home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / CyberStarter / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.4 KB  |  113 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. // Cyberdog 1.0b3 does not work properly when you call it from threads it did not
  14. // create. Since this is required for our blocking synchronous input code, we can
  15. // not use it until we get a newer Cyberdog. We'll be forced to use idle-time
  16. // input instead, which is clumsier and undesirable in general.
  17. #define USETHREADSFLAG    1
  18.  
  19. #ifndef FWPART_H
  20. #include "FWPart.h"
  21. #endif
  22.  
  23. #ifndef FWCYPART_H
  24. #include "FWCyPart.h"
  25. #endif
  26.  
  27. #if !USETHREADSFLAG
  28.  
  29. #ifndef FWIDLE_H
  30. #include "FWIdle.h"
  31. #endif
  32.  
  33. #ifndef FWCYSTRM_H
  34. #include "FWCyStrm.h"
  35. #endif
  36.  
  37. #endif
  38.  
  39. //========================================================================================
  40. //    Forward Class Declaration
  41. //========================================================================================
  42.  
  43. class FW_CPresentation;
  44. class ODFrame;
  45.  
  46. //========================================================================================
  47. //    CLASS CPart
  48. //========================================================================================
  49.  
  50. class CPart: public FW_CPart
  51. #if !USETHREADSFLAG
  52.     , public FW_CIdler
  53. #endif
  54. {
  55. public:
  56.     FW_DECLARE_AUTO(CPart)
  57.  
  58. //----------------------------------------------------------------------------------------
  59. //    Constructor/Destructor
  60. //
  61. public:
  62.     CPart (ODPart* odPart);
  63.     virtual ~CPart ();
  64.     
  65. //----------------------------------------------------------------------------------------
  66. //    Inherited API from FW_CPart
  67. //
  68. public:
  69.     void                 Initialize (Environment* ev, ODStorageUnit* storageUnit, FW_Boolean fromStorage);
  70.     FW_CContent*         NewPartContent (Environment* ev);
  71.     FW_CFrame*             NewFrame (Environment* ev, ODFrame* odFrame, 
  72.                                 FW_CPresentation* presentation, FW_Boolean fromStorage);
  73.     
  74.     void                 ExternalizeContent (Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
  75.     FW_Boolean             InternalizeContent (Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
  76.     
  77.     virtual FW_Handled     DoAdjustMenus (Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  78.     virtual FW_Handled    DoMenu (Environment* ev, const FW_CMenuEvent& event);
  79.     
  80. //----------------------------------------------------------------------------------------
  81. //    Cyberdog Support
  82. //
  83. public:
  84.     static void         LoadCyberItem (Environment* ev, void* selfCPart);
  85.     FW_CCyberdogHelper* GetCyberdogHelper();
  86.     
  87. //----------------------------------------------------------------------------------------
  88. //    Data Members
  89. //
  90. public:
  91.     // CONTENTDATA. A real part with more complex data would probably use a content
  92.     // model object and have accessors and the like. A simple text viewer doesn't
  93.     // need that.
  94.     Handle             fDownloadedText;
  95.     FW_Boolean         fAutoReload;
  96.     long             fStartTime;
  97.  
  98. private:
  99.     FW_CCyberdogHelper* fCyberdogHelper;
  100.     FW_CPresentation*     fPresentation;
  101. };
  102.  
  103. //----------------------------------------------------------------------------------------
  104. //    CPart::GetCyberdogHelper
  105. //----------------------------------------------------------------------------------------
  106. inline FW_CCyberdogHelper* CPart::GetCyberdogHelper ()
  107. {
  108.     return fCyberdogHelper;
  109. }
  110.  
  111. #endif // PART_H
  112.  
  113.